package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbOfflineTaskMapper;
import com.ruoyi.system.domain.TbOfflineTask;
import com.ruoyi.system.service.ITbOfflineTaskService;

/**
 * 离线包虚拟推送任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-03
 */
@Service
public class TbOfflineTaskServiceImpl implements ITbOfflineTaskService 
{
    @Autowired
    private TbOfflineTaskMapper tbOfflineTaskMapper;

    /**
     * 查询离线包虚拟推送任务
     * 
     * @param id 离线包虚拟推送任务主键
     * @return 离线包虚拟推送任务
     */
    @Override
    public TbOfflineTask selectTbOfflineTaskById(Long id)
    {
        return tbOfflineTaskMapper.selectTbOfflineTaskById(id);
    }

    /**
     * 查询离线包虚拟推送任务列表
     * 
     * @param tbOfflineTask 离线包虚拟推送任务
     * @return 离线包虚拟推送任务
     */
    @Override
    public List<TbOfflineTask> selectTbOfflineTaskList(TbOfflineTask tbOfflineTask)
    {
        return tbOfflineTaskMapper.selectTbOfflineTaskList(tbOfflineTask);
    }

    /**
     * 新增离线包虚拟推送任务
     * 
     * @param tbOfflineTask 离线包虚拟推送任务
     * @return 结果
     */
    @Override
    public int insertTbOfflineTask(TbOfflineTask tbOfflineTask)
    {
        tbOfflineTask.setCreateTime(DateUtils.getNowDate());
        return tbOfflineTaskMapper.insertTbOfflineTask(tbOfflineTask);
    }

    /**
     * 修改离线包虚拟推送任务
     * 
     * @param tbOfflineTask 离线包虚拟推送任务
     * @return 结果
     */
    @Override
    public int updateTbOfflineTask(TbOfflineTask tbOfflineTask)
    {
        tbOfflineTask.setUpdateTime(DateUtils.getNowDate());
        return tbOfflineTaskMapper.updateTbOfflineTask(tbOfflineTask);
    }

    /**
     * 批量删除离线包虚拟推送任务
     * 
     * @param ids 需要删除的离线包虚拟推送任务主键
     * @return 结果
     */
    @Override
    public int deleteTbOfflineTaskByIds(Long[] ids)
    {
        return tbOfflineTaskMapper.deleteTbOfflineTaskByIds(ids);
    }

    /**
     * 删除离线包虚拟推送任务信息
     * 
     * @param id 离线包虚拟推送任务主键
     * @return 结果
     */
    @Override
    public int deleteTbOfflineTaskById(Long id)
    {
        return tbOfflineTaskMapper.deleteTbOfflineTaskById(id);
    }
}
